//
//  YHPopBaseView.h
//  MoreCoin
//
//  Created by 林宁宁 on 2019/9/23.
//  Copyright © 2019 MoreCoin. All rights reserved.
//

#import "YHBaseView.h"

NS_ASSUME_NONNULL_BEGIN

@protocol YHPopBaseViewDelegate <NSObject>

- (void)yh_setupUI;
- (void)yh_setupData;
- (void)yh_popShowAnimation;
- (void)yh_popDismissAnimation;
- (void)yh_tapBgEvent;

@end

@interface YHPopBaseView : YHBaseView<YHPopBaseViewDelegate>

/** 弹出的视图 添加到目标视图上 如果没有则添加到window上*/
@property (weak, nonatomic) UIView * popSuperV;
@property (weak, nonatomic) UIViewController * popTargetVC;

@property (retain, nonatomic) UIView * contentView;
@property (retain, nonatomic) UIButton * closeBtn;

@property (assign, nonatomic, readonly) BOOL isShowed;
@property (retain, nonatomic, readonly) UIView * backgroundView;

@property (copy, nonatomic) void(^didShowBlock)(void);
@property (copy, nonatomic) void(^didCloseBlock)(void);
@property (copy, nonatomic) void(^clickCloseBlock)(void);//点击关闭按钮

/** 点击 背景关闭 默认YES*/
@property (assign, nonatomic) BOOL tapBgToClose;

//是否显示毛玻璃 默认NO
@property (assign, nonatomic) BOOL isBlurShow;
@property (assign, nonatomic) BOOL popFromBottom;

/// 一直长留
@property (assign, nonatomic) BOOL isAlwaysStay;

- (void)addCloseButton;
- (void)addCloseButtonWithCloseImg:(NSString *)closeImg;
-(void)addCloseBtn:(SEL)action;
-(void)addCloseBlock:(void(^)(void))block;
-(void)addCloseBtn:(SEL)action closeImg:(UIImage * _Nullable)closeImg;
- (UIButton *)creatCloseBtn:(SEL)action;

- (void)popShow;
- (void)popDismiss;

+ (void)cleanPopView;

@end

NS_ASSUME_NONNULL_END
